package com.example.newinfinity.View.DrawShape

import android.graphics.Canvas
import android.graphics.Paint

//画矩形
class RectangleShape() : Shape() {
    override fun draw(canvas: Canvas) {
        //绘制矩形
        canvas.drawRect(rectF, mPaint)

        //继承父类 拖拉点拽状态为selected时显示边框及四个拖拉圆点
        super.draw(canvas)
    }

    override fun fillColor() {
        //填充时画笔模式修改为fill
        mPaint.style = Paint.Style.FILL
        super.fillColor()
    }

    override fun containsPointInPath(x: Float, y: Float): Boolean {
        return rectF.contains(x,y)
    }
}